package com.flx.ark.algo;

import java.util.BitSet;

/**
 * @Author Fenglixiong
 * @Create 2021/12/8 23:58
 * @Description
 **/
public class BitSetTest {

    public static void main(String[] args) {

        int[] a = {1,2,3,4,5,6,99};
        BitSet bitSet = new BitSet();//默认64
        for (int i = 0; i < a.length; i++) {
            bitSet.set(a[i],true);
        }
        System.out.println(bitSet.size());//128
        System.out.println(bitSet.get(3));//true
        System.out.println(bitSet.get(99));//false
    }

}
